<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<input type="hidden" name="zh_parsen/fzr_name"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>" />
<input type="hidden" name="zh_parsen/fzr_mobile"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>" />
<input type="hidden" name="zh_parsen/fzr_tel"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>" />
<input type="hidden" name="zh_parsen/fzr_email"
    value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>" />
<div class="t_bar">项目基本情况</div>
<table class="t_css" width="100%" id="table_01">
    <col style="width: 20%" />
    <col style="width: 30%" />
    <col style="width: 20%" />
    <col style="width: 30%" />

    <tr>
        <td align="right"><span class="color_red">*</span>孵化器名称：</td>
        <td colspan="5">
            <input type='text' name='proposal/zh_title' id='zh_title' style="width: 80%"
                class=" required" maxlength="50"
                value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="孵化器名称">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>运营主体名称(盖章)：</td>
        <td colspan="5">
            <input type="text" label="运营主体名称" name="proposal/operating_principal_name"
                class=" required" maxlength="50" style="width: 80%"
                value="<x:out select="$xmlData/data/proposal/operating_principal_name" />">
        </td>
    </tr>
    <tr>
		<td align="right"><span class="color_red">*</span>孵化器性质：</td>
 		 <td colspan="5" align="center">
		   	<c:set var = "fuhuaqi_nature_value"><x:out select="$xmlData/data/proposal/fuhuaqi_nature_value" /></c:set>
          	<label> <input type="radio" class="do"  id="" onclick="changeFhq();" style="margin-left: 70px;vertical-align: middle; float: left;" name="fuhuaqi_nature" label="事业" value="01" />
          		<span style="vertical-align: middle;float: left; =">事业</span></label> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			
			<label> <input type="radio" class="do" id="" onclick="changeFhq();" style="margin-left: 70px;vertical-align: middle;float: left;" name="fuhuaqi_nature" label="企业 " value="02" />
				<span style="=vertical-align: middle;float: left;">企业</span></label> &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            
 			<label> <input type="radio" class="do" id="" onclick="changeFhq();" style="margin-left: 70px;vertical-align: middle;float: left;" name="fuhuaqi_nature" label="民间组织 " value="03" />
				<span style="=vertical-align: middle;float: left;">民间组织</span></label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;        
            
			<label> <input type="radio" class="do" id="other04" onclick="changeFhq();" style="margin-left: 70px;vertical-align: middle;float: left;" name="fuhuaqi_nature" label="其它 " value="04" />
				<span style="=vertical-align: middle;float: left;">其他</span></label>	           
            <c:if test="${fn:contains(fuhuaqi_nature_value, '04')}">
            <input type="text" id="fuhuaqi_nature_other" name="proposal/fuhuaqi_nature_other" maxlength="50" label="孵化器性质-->其他" 
             style="border:0px;border-bottom:#000000 1px solid;float: left; display:block;" value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_other" />"/>
             </c:if>
              <c:if test="${not fn:contains(fuhuaqi_nature_value, '04')}">
            <input type="text" id="fuhuaqi_nature_other" name="proposal/fuhuaqi_nature_other" maxlength="50" label="孵化器性质-->其他"
             style="border:0px;border-bottom:#000000 1px solid;float: left; display:none;" value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_other" />"/>
             </c:if>
            <input type="hidden" id="fuhuaqi_nature_value"  name="proposal/fuhuaqi_nature_value" type="text" label="孵化器性质"  class="required"  value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_value" />" />
            <input type="hidden" name="proposal/fuhuaqi_nature_name" value="<x:out select="$xmlData/data/proposal/fuhuaqi_nature_name" />" />
          </td>
	</tr>
     <tr>
        <td align="right"><span class="color_red">*</span>孵化器类型：</td>
        <td colspan="5"  align="center"  >
             <c:set var="incubator_type"><x:out select="$xmlData/data/proposal/incubator_type" /></c:set>
			  <cpt:checkbox key="incubator_type" name="incubator_type" value="${incubator_type }" width="10px;"  repeatColumn="4" tagType="radio" ></cpt:checkbox>
		  	  <input type="hidden" id="incubator_type_value" name="proposal/incubator_type_value"  style="background-color:#F1F1F1;" class="required"  value="<x:out select="$xmlData/data/proposal/incubator_type_value" />" label="孵化器类型">
		  	  <input type="hidden" style="background-color:#F1F1F1;" name="proposal/incubator_type_name" value="<x:out select="$xmlData/data/proposal/incubator_type_name" />">
        </td>
    </tr>
    <tr>
    	<td align="right" ><span class="color_red">*</span>组织机构代码：</td>
        <td >
            <input type="text" label="组织机构代码"  name="proposal/org_code"
               class="required orgCard"  maxlength="11"
                value="<x:out select="$xmlData/data/proposal/org_code" />">
        </td>
        <td align="right"><span class="color_red">*</span>法人代表：</td>
        <td >
            <input type="text" label="法人代表" name="proposal/legal_representative"
                class="required "  maxlength="11"
                value="<x:out select="$xmlData/data/proposal/legal_representative" />">
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>注册时间：</td>
        <td >
            <c:set var="register_date">
                <x:out select="$xmlData/data/proposal/register_date" />
            </c:set>
            <cpt:date id="register_date_curr" name="proposal/register_date" value="${register_date}"
               className="required date " label="注册时间"></cpt:date>
        </td>
        <td align="right"><span class="color_red">*</span>开始运营时间：</td>
        <td>
            <c:set var="Begin_operation_date">
                <x:out select="$xmlData/data/proposal/begin_operation_date" />
            </c:set>
            <cpt:date id="Begin_operation_date_curr" name="proposal/begin_operation_date" value="${Begin_operation_date}"
                className="required date " label="开始运营时间"></cpt:date>
        </td>
    </tr>
    <tr>
        <td align="right"><span class="color_red">*</span>注册资本(万元)：</td>
        <td >
             <input type="text" label="注册资本" name="proposal/registered_capital"
                class="required" maxlength="50"  onfocus="InitInput.setNumber(this,9,2,2)"
                value="<x:out select="$xmlData/data/proposal/registered_capital" />">
        </td>
        <td align="right"><span class="color_red">*</span>注册地址：</td>
        <td >
             <input type="text" label="注册地址" name="proposal/registered_address"
                class=" required" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/registered_address" />">
        </td>
    </tr>
    <tr>
       <td align="right"><span class="color_red">*</span>联系人姓名：</td>
        <td>
             <input type="text" label="联系人姓名" name="proposal/contact_psn_cname"
                class="required" maxlength="30"
                value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />"/>
        </td>
        <td align="right"><span class="color_red">*</span>联系人手机：</td>
        <td>
            <input type="text" label="联系人手机" name="proposal/contact_psn_mobile"
                class=" required mobile" onfocus="InitInput.setNumber(this,11,0,0)"
                maxlength="11"
                value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
        </td>
    </tr>
    <tr>
       <td align="right"><span class="color_red">*</span>电子邮箱：</td>
        <td >
            <input type="text" label="电子邮箱" name="proposal/contact_psn_email"
                class="required email" maxlength="50"
                value="<x:out select="$xmlData/data/proposal/contact_psn_email" />">
        </td>
        <td align="right"><span class="color_red">*</span>传真：</td>
        <td>
            <input type="text" label="传真" name="proposal/contacts_facsimile"
                class="required "  maxlength="11"
                value="<x:out select="$xmlData/data/proposal/contacts_facsimile" />">
        </td>
    </tr>
	<tr>
       <td align="right"><span class="color_red">*</span>孵化场总面积(平方米)：</td>
        <td  >
            <input type="text" label="孵化场总面积" name="proposal/hatchery_area" style="text-align: right;"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,2,2)"
                value="<x:out select="$xmlData/data/proposal/hatchery_area" />">
        </td>
        <td align="right" ><span class="color_red">*</span>在孵企业使用场地面积(平方米)：</td>
        <td >
            <input type="text" label="在孵企业使用场地面积" name="proposal/incubating_enterprises_site_area"
                class=" required " onfocus="InitInput.setNumber(this,9,2,2)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/incubating_enterprises_site_area" />">
        </td>
    </tr>
    
    <tr>
       <td align="right"><span class="color_red">*</span>在孵企业数量：</td>
        <td >
            <input type="text" label="在孵企业数量" name="proposal/incubating_enterprises"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)"
                value="<x:out select="$xmlData/data/proposal/incubating_enterprises" />" style="text-align: right;">
        </td>
        <td align="right"><span class="color_red">*</span>累计毕业企业数量：</td>
        <td>
            <input type="text" label="累计毕业企业数量" name="proposal/graduated_enterprise"
                class=" required " onfocus="InitInput.setNumber(this,9,0,0)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/graduated_enterprise" />">
        </td>
    </tr>
    <tr>
       <td align="right"><span class="color_red">*</span>管理人员数量：</td>
        <td > 
            <input type="text" label="管理人员数量" name="proposal/number_managers" style="text-align: right;"
                class=" required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)" id="managers_number"
                value="<x:out select="$xmlData/data/proposal/number_managers" />">
        </td>
        <td align="right"><span class="color_red">*</span>管理人员中大专以上学历数量：</td>
        <td>
            <input type="text" label="管理人员中大专以上学历数量" name="proposal/managers_college_degree_above"
                class="required " onfocus="InitInput.setNumber(this,9,0,0)"
                maxlength="11" style="text-align: right;" id="managers_college_degree_above"
                value="<x:out select="$xmlData/data/proposal/managers_college_degree_above" />">
        </td>
    </tr>
    <tr>
       <td align="right"><span class="color_red">*</span>管理人员接受专业培训人员数量：</td>
        <td   >
            <input type="text" label="管理人员接受专业培训人员数量" name="proposal/managers_training_personnel" style="text-align: right;"
                class="required " maxlength="50" onfocus="InitInput.setNumber(this,9,0,0)"  id="managers_training_personnel"
                value="<x:out select="$xmlData/data/proposal/managers_training_personnel" />">
        </td>
        <td align="right"><span class="color_red">*</span>孵化器自有种子资金或孵化资金额(万元)：</td>
        <td>
            <input type="text" label="孵化器自有种子资金或孵化资金额" name="proposal/seed_money"
                class="required " onfocus="InitInput.setNumber(this,9,2,2)"
                maxlength="11" style="text-align: right;"
                value="<x:out select="$xmlData/data/proposal/seed_money" />">
        </td>
    </tr>
    
        </table>
    <table class="t_css" width="100%" id="table_02">
		    <col style="width: 20%" />
		    <col style="width: 30%" />
		    <col style="width: 20%" />
		    <col style="width: 30%" />
    <tr>
     <td align="right"><span class="color_red">*</span>归口管理部门：</td>
     <td>
            <c:set var="recomend_org">{'id':'<x:out
                    select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out
                    select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
            <cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang "
                readonly="true" value="${recomend_org}" label="归口管理部门" id="recomend_org"
                onlyChooseLeaf="false" showPattern="all" shieldPattern="0" topCheckbox="true"
                onClick="initTreeValueExt" />
            <input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"
                class="required"
                value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理部门">
            <input type="hidden" name="proposal/recomend_org_name"
                value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
       </td>
            <td align="right" ><span class="color_red">*</span>申报日期：</td>
            <td>
                <c:set var="submit_date">
                    <x:out select="$xmlData/data/proposal/submit_date" />
                </c:set>
                <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期" ></cpt:date>
            </td>
        </tr>
</table>

<table class="t_css" width="100%" style="text-align: center;" id="table_03">
    <col style="width: 20%;" />
    <col style="width: 80%;" />
    <tr>
        <td align="right">
          <span class="color_red">*</span>项目简述：<br />（限280字）
        </td>
        <td>
            <textarea name="proposal/prj_brief" class="input_textarea required maxlength:280"
                label="项目简述" style="width: 98%" rows="9"><x:out
                    select="$xmlData/data/proposal/prj_brief" /></textarea>
            <input type="hidden" name="proposal/prj_brief_hidden" value=""/>
        </td>
    </tr>
</table>



<script type="text/javascript">
$('#topic_level1_year1_count,#topic_level1_year2_count,#topic_level1_year3_count').change(function(){
	getTotalCount('topic_level1_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level1_year1_fund,#topic_level1_year2_fund,#topic_level1_year3_fund').change(function(){
	getTotalCount('topic_level1_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level2_year1_count,#topic_level2_year2_count,#topic_level2_year3_count').change(function(){
	getTotalCount('topic_level2_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level2_year1_fund,#topic_level2_year2_fund,#topic_level2_year3_fund').change(function(){
	getTotalCount('topic_level2_','year1_fund,year2_fund,year3_fund','total_fund',true);
});
$('#topic_level3_year1_count,#topic_level3_year2_count,#topic_level3_year3_count').change(function(){
	getTotalCount('topic_level3_','year1_count,year2_count,year3_count','total_count',false);
});
$('#topic_level3_year1_fund,#topic_level3_year2_fund,#topic_level3_year3_fund').change(function(){
	getTotalCount('topic_level3_','year1_fund,year2_fund,year3_fund','total_fund',true);
});

/*
----------------------by zk
        描述：计算数值总数
        参数prefix：公共的id开头
        参数count：需要加的数的id结尾     以,分割
        参数total：总数id结尾
        参数isDeciaml：是否为小数 默认为false
*/
function getTotalCount(prefix,count,total,isDecimal){
  var defaultIsDecimal = false;//默认为整数
  if(isDecimal==null){
        isDecimal = defaultIsDecimal;
  }
  var numStr = count.split(',');
  var totalCount = 0;//总数
  if(!isDecimal){
        for ( var int = 0; int < numStr.length; int++) {
             var num = $('#'+prefix+numStr[int]).val();
             if(!$.isNumeric(num))
                  num = "0";
             totalCount += parseInt(num);
       }
  }else {
     for ( var int = 0; int < numStr.length; int++) {
         var num = $('#'+prefix+numStr[int]).val();
         if(!$.isNumeric(num))
             num = "0";
         totalCount += parseFloat(num);
     }
     totalCount = ((totalCount/100)*100).toFixed(2);
  }
  if(totalCount == 0){
        $('#'+prefix+total).val("");
  }else {
        $('#'+prefix+total).val(totalCount);
  }
}
function changeFhq(){
	if ($("input[id$='other04']").prop('checked')){
		$("input[id$='fuhuaqi_nature_other']").removeAttr("class");
		$("input[id$='fuhuaqi_nature_other']").css("display","block");
		$("input[id$='fuhuaqi_nature_other']").addClass("required");
	}else{
 		$("input[id$='fuhuaqi_nature_other']").css("display","none");
		$("input[id$='fuhuaqi_nature_other']").removeAttr("class");
		$("input[id$='fuhuaqi_nature_other']").val(" ");
	}
}


function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
}
</script>	